function maximum (t)
	local max_idx = 1
	local max_val = t[max_idx]
	for i = 1, #t do
		if t[i] > max_val then
			max_idx = i
			max_val = t[i]
		end
	end
	return max_val, max_idx
end

--test
table = {1, 32, 5, 3, 6, 6, 7}
print(maximum(table))
